package com.fly.studio.home.app.concurrency;

import com.jd.platform.async.callback.IWorker;

import java.util.HashMap;
import java.util.Map;

/**
 * @author fuliying3
 * @date 2022/09/22 14:21:00
 */
public class ParWorkerFactory {

    private static final Map<String, FloorWorker> WORKER_MAP = new HashMap<>(16);

    public IWorker getFloorWorker(String workerName) {
        return WORKER_MAP.get(workerName);
    }

    public ParWorkerFactory () {
        WORKER_MAP.put("parWorker1", new ParWorker1());
        WORKER_MAP.put("parWorker2", new ParWorker2());
        WORKER_MAP.put("parWorker3", new ParWorker3());
        WORKER_MAP.put("parWorker4", new ParWorker4());
        WORKER_MAP.put("parWorker5", new ParWorker5());
    }

}
